package main.java.chessfootball.model.game;

import main.java.chessfootball.model.play.Vector;

/**
 * User: Igor
 * Date: 10.06.2011
 * Time: 21:48:14
 */
public class Ball
{
	public static final int SPEED_DRIBBLING = 4;
	public static final int SPEED_KICK = 8;

	private Cell cell;
	private int position;

	public Ball(int x, int y)
	{
		cell = new Cell(x, y);
	}

	public void move(Vector to, int length)
	{
		cell = to.getCell(cell, length);
		position = position + length * (length > 1 ? SPEED_KICK : SPEED_DRIBBLING);
	}

	public void put(Cell on)
	{
		cell = on;
	}

	public Cell getCell()
	{
		return cell;
	}

	public int getPosition()
	{
		return position;
	}
}
